package com.kaishengit.service;

import java.util.List;
import com.kaishengit.dao.GoalDao;
import com.kaishengit.dao.TaskDao;
import com.kaishengit.dao.UserDao;
import com.kaishengit.dao.UserProjectDao;
import com.kaishengit.entity.Project;
import com.kaishengit.entity.Task;
import com.kaishengit.entity.User;
import com.kaishengit.entity.UserProject;
import com.kaishengit.util.DateUtil;
import com.kaishengit.util.PkUtil;
public class TaskService {
	TaskDao taskdao=new TaskDao();
	UserDao userdao=new UserDao();
	GoalDao goaldao=new GoalDao();
	UserProjectDao  userprojectdao=new UserProjectDao();
	public List<Task> findByGoalId(String GoalId){
		
		return taskdao.findByGoalId(GoalId);
		
	}
	public void del (String taskid){
		taskdao.del(taskid);
		
		
	}

	public void save(String name, String desc, String state, String level,
			String begintime, String endtime, String manager, String id) {
		
	    Task task=new Task();
		task.setCreatetime(DateUtil.getNowDateTime());
		task.setId(PkUtil.getId());
		task.setName(name);
		task.setDesc(desc);
		task.setState(state);

		task.setLevel(level);
		task.setBegintime(begintime);
		task.setEndtime(endtime);
		task.setRate("0");
		task.setUserid(manager);
		task.setGoalid(id);
		taskdao.save(task);
		
	}
	
}
